/*
Neil Malhotra	
Proposal title: Economic Spillovers of Political Polarization


HYPOTHESES

Stated-Hyp1: "will respondents leave money on the table if it means enriching the other party?" (p. 2)

	Test-Hyp1: Partisan respondents will be more likely to select non-partisan offer vs. partisan offer.

Stated-Hyp2: "Individuals with extreme attitudes on social issues will more frequently eschew economic gains to express partisan goals (compared to those with extreme attitudes on economic issues) because social issues are more strongly associated with affective polarization. 
They will also be less supportive of the partisan offer in Condition 2 and less sensitive to the increased payment in Condition 3." (p. 4)

	// NOTE: we cannot test the second part of this hypothesis directly because the treatment conditions in the proposal and fielded questionnaire are different. 

	Test-Hyp2: Rates of selection of non-partisan offer will be higher among those with extreme attitudes on social issues vs. economic issues. 

	Test-Hyp3: The effect of change in payment size between conditions 1 and 2 will be smaller for those with extreme positions on social issues vs. those with extreme position on economic issues. 
	

Stated-Hyp3: "Individuals who possess a stronger partisan identification will exhibit a stronger preference for the non-partisan offer (to avoid the discomfort of aiding the opposing party). 
They will also be less supportive of the partisan offer in Condition 2 and less sensitive to the increased payment in Condition 3" (p. 4)

	// NOTE: we cannot test the second part of this hypothesis directly because the treatment conditions in the proposal and fielded questionnaire are different. 


	Test-Hyp4: Rates of selection of non-partisan offer will be higher among those with strong partisan identities vs. weak partisan identities. 

	Test-Hyp5: The effect of change in payment size between conditions 1 and 2 will be smaller for those with strong partisan identities vs. weak partisan identities. 

Stated-Hyp4: "Individuals who are better sorted ideologically (i.e., liberal Democrats and conservative Republicans) will exhibit a stronger preference for the non-partisan offer in all conditions. 
They will also be more sensitive to increased donation to the opposite party in Condition 2 and less sensitive to the increased payment in Condition 3." (p. 4)

	// NOTE: we cannot test the second part of this hypothesis directly because the treatment conditions in the proposal and fielded questionnaire are different. 


	Test-Hyp6: Rates of selection of non-partisan offer will be higher among those who are better politically sorted vs. those who are worse sorted. 
	
	Test-Hyp7: The effect of change in payment size between conditions 1 and 2 will be smaller for those who are well sorted vs. worse sorted. 	
 
	
********************************************************************************
NOTES:
- For stated hypothesis 2, proposal did not define what extreme positions mean. 
We are defining it as strong (dis)agreement.	

- For stated hyp. 2-4, we cannot test the second part of the hypotheses directly 
because the treatment conditions in the proposal and fielded questionnaire are 
different. 

- For stated hyp 2, authors don't define political sorting. We are coding 
lib/extreme lib =liberal (and extreme/cons = conservative).
*/

clear all
use "Malhotra634.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

* who gets donatio in scenario B?
	tab XTESS182
	lab def treat 1 "1. opp. party" 2 "2. opp party" 3 "3. atheists" 4 "4. opp. coast states"
	gen treat= XTESS182
	lab val treat treat
	tab treat
	
	
* OUTCOME MEASURES

	foreach var in A B C D {
		tab Q8`var'
		recode Q8`var' (1=1) (2=0) (-1=.)
		tab Q8`var', mis		
	}

	gen select_nonpartisan=Q8A 
	replace select_nonpartisan= Q8B if select_nonpartisan==.
	replace select_nonpartisan= Q8C if select_nonpartisan==.
	replace select_nonpartisan= Q8D if select_nonpartisan==.	
	tab select_nonpartisan, mis
	
* MODERATORS

* respondent partisan identity
	tab Q1
	recode Q1 (1/2=1 "partisan respondent") (3=0 "non-partisan resp.") (-1=.), gen(partisanresp)
	tab partisanresp

	
* extreme position	
	* extreme position on social issues
		/*
		"This country would have many fewer problems if there were more emphasis on traditional family ties."
		Do you agree or disagree with this statement?
		*/
		tab Q4
		recode Q4 (-1=.) (1 5 =1 "extreme") (2/4=0 "non-extreme"), gen(extreme_social)
		tab extreme_social
		
	* extreme position on economic issues
		/*
		"The government should take measures to reduce differences in income levels." 
		Do you agree or disagree with this statement? 
		*/
		tab Q5
		recode Q5 (-1=.) (1 5 =1 "extreme") (2/4=0 "non-extreme"), gen(extreme_economic)
		tab extreme_economic
		
	* extreme social vs. economic
		gen extreme_soc_vs_econ = 1 if extreme_social==1 & extreme_economic==0
		replace extreme_soc_vs_econ = 0 if extreme_social==0 & extreme_economic==1
		tab extreme_soc_vs_econ
	
* partisan identification strength
		tab Q1A
		tab Q1B
		foreach var in A B {
		recode Q1`var' (-1=.) (1=1) (2=0)
		}
		
		gen strongpartisan=Q1A 
		replace strongpartisan=Q1B if strongpartisan==.
		tab strongpartisan
		
* political sorting
	* party
		tab Q1
		replace Q1=. if Q1==-1
		
	* ideology
		tab IDEO_New
		replace IDEO_New=. if IDEO_New==-1
		
	* well-sorted	
		gen wellsorted= 1 if Q1==1 & IDEO_New==1|IDEO_New==2
		replace wellsorted= 1 if Q1==2 & IDEO_New==6|IDEO_New==7
		replace wellsorted= 0 if Q1==3 ///
		| (Q1==1&IDEO_New>2 & IDEO_New<8) ///
		| (Q1==2& IDEO_New<6) 
		tab wellsorted
		
		tab wellsorted Q1
		tab wellsorted IDEO_New
		
		
********************************************************************************

* ANALYSIS
	

*Test-Hyp1: Partisan respondents will be more likely to select non-partisan offer vs. partisan offer.

	reg select_nonpartisan i.partisanresp if treat<=2
	// do not reject.  0.000 
	tess 1.partisanresp +, init(Malhotra634)
	
*Test-Hyp2: Rates of selection of non-partisan offer will be higher among those with extreme attitudes on social issues vs. economic issues. 
	
	reg select_nonpartisan i.extreme_soc_vs_econ if treat<=2	
	// reject. 0.915
	tess 1.extreme_soc_vs_econ +
	
	
*Test-Hyp3: The effect of change in payment size between conditions 1 and 2 will be smaller for those with extreme positions on social issues vs. those with extreme position on economic issues. 	

	reg select_nonpartisan i.extreme_soc_vs_econ##i.treat if treat<=2	
	// reject. 0.112
	tess 1.extreme_soc_vs_econ#2.treat -
	
*Test-Hyp4: Rates of selection of non-partisan offer will be higher among those with strong partisan identities vs. weak partisan identities. 
	
	reg select_nonpartisan i.strongpartisan if treat<=2	
	// do not reject. 0.000	
	tess 1.strongpartisan +
	
*Test-Hyp5: The effect of change in payment size between conditions 1 and 2 will be smaller for those with strong partisan identities vs. weak partisan identities. 	
	reg select_nonpartisan i.strongpartisan##i.treat if treat<=2	
	// reject. 0.604	
	tess 1.strongpartisan#2.treat -
	
*Test-Hyp6: Rates of selection of non-partisan offer will be higher among those who are better politically sorted vs. those who are worse sorted. 
	reg select_nonpartisan i.wellsorted if treat<=2	
	// do not reject. 0.000
	tess 1.wellsorted +
	
*Test-Hyp7: The effect of change in payment size between conditions 1 and 2 will be smaller for those who are well sorted vs. worse sorted. 	
	reg select_nonpartisan i.wellsorted##i.treat if treat<=2	
	// reject. 0.713	 	
	tess 1.wellsorted#2.treat -	
